﻿@{
    Layout = null;
   
}
@model ElingOA6_DSJCJ.Model.Document
<!DOCTYPE html>
<html>
<head>
    <title>@ElingOA6_DSJCJ.Common.GlobalConstant.CONSTRING_SYSTITLE</title>
    <link href="@Url.Content("~/Content/ztzlcss.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script>

        //发布信息
        function btnOk() {
            docId = $("#hidDocId").val();
            var txtCon = $.trim($('#txtCon').val());
            if (txtCon == "") {
                alert("请输入内容");
                $('#txtCon').focus();
                return;
            }

            //$('#txtCon').attr("disabled", "disabled");

            if ($('#txtCon').val() != "") {
                $.ajax({
                    type: 'POST',
                    url: '/Index/DocLeadInstruct',
                    data: { docid: docId, content: txtCon },
                    success: function (result) {
                        if (result == "empty") {
                            alert("请重新登录或者输入文本内容");
                        }
                        else if (result == "yes") {

                            alert("批示成功");

                            window.location = window.location.href;
                        }
                        else {
                            alert("批示失败");
                        }

                        //$('#txtCon').removeAttr("disabled");
                    }
                });
            }
        }

        function btnDel() {
            docId = $("#hidDocId").val();
            $.ajax({
                type: 'POST',
                url: '/Index/DelInstruct',
                data: { docid: docId },
                success: function (result) {
                    if (result == "empty") {
                        alert("删除失败");
                    }
                    else {
                        alert(result);
                        window.location = window.location.href;
                    }
                }

            });
        }
        //获取批示内容
        function btnUpdate() {
            docId = $("#hidDocId").val();
            $.ajax({
                type: 'POST',
                url: '/Index/GetInstruct',
                data: { docid: docId },
                success: function (result) {
                    if (result == "empty") {
                        alert("获取失败");
                    }
                    else {
                        $('#txtCon').focus();
                        $("#txtCon").val(result);

                    }
                }

            });
        }
</script>

</head>
<body>
<div class="ztzl-main">
    <div class="ztzl-header"><img src="@ViewData["logUrl"].ToString()" width="1000" height="226"/></div>
    <div class="ztzl-maincon">
        <table width="990" cellspacing="0" style="margin-top: 5px;">
            <tr>
                <td valign="top">
                    <table width="990" cellspacing="0">
                        <tr>
                            <td>
                                <table width="900" height="500" cellspacing="0" style="margin-left:45px;" >
                                    <tr>
                                        <td height="35" align="center" class="nytitle">
                                            @Model.FTitle</td>
                                    </tr>
                                    <tr>
                                        <td height="15" align="right" class="db">
                                            @Model.FDeptName&nbsp;&nbsp;&nbsp;&nbsp;@Model.FAuthor&nbsp;&nbsp;&nbsp;&nbsp;@Model.FPubDate.ToString("yyyy-MM-dd")&nbsp;&nbsp;&nbsp;&nbsp;访问次数： @Model.FReadCnt.ToString()</td>
                                    </tr>
                                    @if (Model.FEditMode == "H")
                                    {
                                
                                        <tr>
                                            <td colspan="2" align="left"  valign="top" style="padding: 5px 10px 0 10px; font-size: 14px; line-height: 25px;" class="autoimg">
                                                @Html.Raw(Model.FContentTxt) </td>
                                        </tr>
                                    }
                                    else
                                    {
                                        if (Model.FEditMode == "O")
                                        {
                                        <tr>
                                            <td colspan="2" align="left" class="hg25 db" style="padding: 5px 10px 0 10px; font-size: 14px; line-height: 30px;">
                                                <div style="width: 980px" align="center">

                                                    <script>
                                                        var ProductCaption = '@ViewData["ProductCaption"]';
                                                        var ProductKey = '@ViewData["ProductKey"]';
                                                    </script>

                                                    <script src="@Url.Content("~/Scripts/ntkoofficecontrol.js", true)" type="text/javascript"></script>

                                                    <!--控件事件代码开始-->

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnFileCommand(cmd,canceled);">
	                                    alert(cmd);
	                                    CancelLastCommand=true;
                                                    </script>

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnDocumentClosed();">
	                                    setFileOpenedOrClosed(false);
                                                    </script>

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnDocumentOpened(TANGER_OCX_str,TANGER_OCX_obj);">
                                            //TANGER_OCX_OBJ.SetReadOnly(true);//文件只读保护,setreadonly方法
                                            TANGER_OCX_OBJ.ToolBars = false;		       
                                                    </script>

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="BeforeOriginalMenuCommand(TANGER_OCX_str,TANGER_OCX_obj);">
	                                    alert("BeforeOriginalMenuCommand事件被触发");
                                                    </script>

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnFileCommand(TANGER_OCX_str,TANGER_OCX_obj);">
	                                    if (TANGER_OCX_str == 3) 
	                                    {
		                                    alert("不能保存！");
		                                    CancelLastCommand = true;
	                                    }
                                                    </script>

                                                    <script language="JScript" for="TANGER_OCX" event="OnCustomMenuCmd2(menuPos,submenuPos,subsubmenuPos,menuCaption,menuID)">
		                                //alert("第" + menuPos +","+ submenuPos +","+ subsubmenuPos +"个菜单项,menuID="+menuID+",菜单标题为\""+menuCaption+"\"的命令被执行.");
		                                if("全网页查看"==menuCaption)objside();
		                                if("恢复原大小"==menuCaption)objside2();
                                                    </script>

                                                    <script type="text/javascript" language="JScript" for="TANGER_OCX" event="AfterPublishAsPDFToURL(result,code);">
	                                    result=trim(result);
	                                    alert(result);
	                                    if(result=="succeed")
	                                    {window.close();}
                                                    </script>

                                                    <!--控件事件代码结束-->
                                                </div>
                                            </td>
                                        </tr>
                                        }
                                    }
                                    <tr align="left">
                                        <td>
                                            @if (null != ViewData["docAttach"])
                                            {
                                                List<ElingOA6_DSJCJ.Model.DocAttach> docAttachList = ViewData["docAttach"] as List<ElingOA6_DSJCJ.Model.DocAttach>;
                                                if (docAttachList.Count > 0)
                                                {
                                                <table width="880" border="0" style="text-align: left" cellpadding="0" cellspacing="0" style="margin-top: 10px;">
                                                    <tr>
                                                        <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                                            <br />
                                                            附件:</td>
                                                    </tr>
                                                    @foreach (ElingOA6_DSJCJ.Model.DocAttach attachModel in docAttachList)
                                                    {
                                                        <tr>
                                                            <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Index/AttachDownLoad?attachID=@attachModel.FAttachID">@(string.IsNullOrEmpty(attachModel.FAttachDesc) ? attachModel.FAttachOldFileName : attachModel.FAttachDesc)</a></td>
                                                        </tr>
                                                    }
                                                </table>
                                                }
                                            }
                                            


                                            @if (ViewData["FIsExamine"].ToString() == "Y")
                {
                    using (Html.BeginForm("DocView", "Index", FormMethod.Post, new { id = "portForm" }))
                    {
                @*局长批示的内容*@
                <table width="880" border="0" cellpadding="0" cellspacing="0"  style="margin-top:10px;">
                @{
                        if (null != ViewData["leadInstruct"])
                        {
                            System.Data.DataSet dslt = ViewData["leadInstruct"] as System.Data.DataSet;
                            if (dslt.Tables[0].Rows.Count > 0)
                            {


                                foreach (System.Data.DataRow row in dslt.Tables[0].Rows)
                                {
                                    if (row["FEmplNo"].ToString() == ViewData["FEmplNo"].ToString())
                                    {
                                <tr>
                <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                    <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                    <span style="color: #a3bb50;">@row["FExamineDate"]</span>&nbsp;&nbsp;&nbsp;<span  onclick="btnUpdate()" style="color: blue;cursor:pointer;">修改</span>|<span onclick="btnDel()" style="color: blue;cursor:pointer;">删除</span> <br />
                    <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>   
                    </td>
                </tr>
                                    }
                                    else
                                    {
                                    <tr>
                <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                    <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                    <span style="color: #a3bb50;">@row["FExamineDate"]</span><br />
                    <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>     
                    </td>
                </tr>
                                    }
                                }


                            }
                        }
          
                    }
                    @if (ViewData["FIsInstruct"].ToString() == "Y")
                    {
                    <tr align="center"><td style="font-size:14px;">局长批示:</td></tr>
                    <tr align="center"><td>@*<input type="text" id="txtCon" />*@
                    @Html.TextArea("txtCon", "", 3, 90, "sty")</td></tr>
                    <tr align="center"><td><input type="button" onclick="btnOk();" value="确定" />
          
                    </td></tr>
                    }
                    </table>
                    <input id="hidDocId" type="hidden" value="@ViewData["FDocId"]" />
            <input id="hidEmplNo" type="hidden" value="@ViewData["FEmplNo"]" />
                    }
                }


                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            @*信息引用*@
           <script type="text/javascript">
               $(function () {
                   $('#spanDocRefImp').html($('#hdDocRefImpClsName').val());
               });
           </script>
           <div style="width:880px; display:block; padding-top:10px; padding-bottom:10px;" align="left">
           <span id="spanDocRefImp" ></span>
           </div>
            @Html.Hidden("hdDocRefImpCls", ViewData["docRefImpClsJson"] == null ? "" : ViewData["docRefImpClsJson"].ToString());
            @Html.Hidden("hdDocRefImpClsName", ViewData["docRefImpClsName"] == null ? "" : ViewData["docRefImpClsName"].ToString());
            <input id="hidDocId" type="hidden" value="@ViewData["FDocId"]" />


                                        </td>
                                    </tr>

                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="ztzl-bottom">@Html.Raw(ViewData["CopyRight"].ToString())</div>
</div>


</body>
</html>
